/**
 * 图片处理
 */
export function imgFilter(imgs) {
  return imgs.map(img => {
    let time = img.split('_')[0]
    let fold = img.split('_')[1]
    let id = img.split('_')[2].split('-')[0]
    let bz = img.split('-')[1].split('.')[0]
    return {
      name: img,
      time,
      bz,
      path: `/static/upload/${fold}/${id}/${img}`
    }
  })
}

/**
 * 处理时间数组
 */
 export function dateRevert(dateArr) {
  if (Array.isArray(dateArr) && dateArr.length > 1 && dateArr[0].length && dateArr[1].length) {
    return dateArr[0] + '_' + dateArr[1]
  } else {
    return ''
  }
}